![]() |
YieldToAnyThread |
||||
Header: | Threads.h | Carbon status: | Supported | |
Relinquishes the current threadís control.
OSErr YieldToAnyThread ();
A result code.
The YieldToAnyThread function invokes the Thread Managerís scheduling mechanism. The current thread relinquishes control and the Thread Manager schedules the next available thread.
The current thread is suspended in the ready state and awaits rescheduling when the CPU is available. When the suspended thread is scheduled again, YieldToAnyThread regains control and returns to the function that called it.
If you have installed a custom scheduler, the Thread Manager passes it the thread ID of the suspended thread.
In each thread you must make one or more strategically placed calls to relinquish control to another thread. You can either make this yield call or another yield call such as YieldToThread; or you can make a call such as SetThreadState to explicitly change the state of the thread.
Threads must yield in the CPU addressing mode (24-bit or 32-bit) in which the application was launched.
To relinquish control to a specific thread, use the YieldToThread function.
To change the state of a specified thread, use the SetThreadState function.
Supported in Carbon. Available in CarbonLib 1.0 and later when ThreadsLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by ThreadsLib 1.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)